<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>子绝父相</title>
    <style>
      .container {
        width: 500px;
        height: 400px;
        background-color: #f00;
        position: relative;
      }
      /* .box 和 container 形成子绝父相 */
      .container > .box {
        width: 300px;
        height: 200px;
        background-color: #0f0;
        position: absolute;
        bottom: 0;
        right: 0;
      }
      /* span 和 .box 形成子绝父绝 */
      .container > .box > span {
        position: absolute;
        bottom: 0;
        left: 0;
      }
    </style>
  </head>

  <body>
    <div class="container">
      <div class="box">
        <span>我是内容</span>
      </div>
    </div>
  </body>
</html>
